package com.example.api.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create with Intellij idea
 * User:mingtian
 * Date:2018/11/14
 * Time:23:21
 */
@RequestMapping("/api")
@RestController
@Api(value = "MemberController", description = "会员服务接口")
public class MemberController {

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/getMember")
    @ApiOperation(value = "提供会员接口", notes = "提供接口被订单服务调用Get")
    public String getMember() {
        System.out.println("我是会员服务,端口:" + serverPort);
        return "我是会员服务,端口:" + serverPort;
    }

    @PostMapping("/postMember")
    @ApiOperation(value = "提供会员接口", notes = "提供接口被订单服务调用Post")
    public String postMember() {
        System.out.println("我是会员服务,端口:" + serverPort);
        return "我是会员服务,端口:" + serverPort;
    }
}
